var rpio = require('rpio');
var pwm_pin = 12;
rpio.open(pwm_pin, rpio.PWM);
rpio.pwmSetClockDivider(8);
rpio.pwmSetRange(pwm_pin, 1024);

function pwm() {
    var data = 0;
    rpio.pwmSetData(pwm_pin, 128);
    while(1){
        data ++;
        if(data >= 1024){
            data = 0;
        }
        rpio.pwmSetData(pwm_pin, data);
        rpio.msleep(6);
    }
}
pwm();
